package com.tsf.demo.inventory.proxy;

import com.tsf.demo.commons.vo.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

//调用Product服务

@FeignClient(name = "tsf-product")
public interface ProductService {

    //库存查询
    @RequestMapping(value = "/product/{id}", method = RequestMethod.GET)
    public Product getProduct(@PathVariable String id);

    //入库
    @RequestMapping(value = "/inventory/inbound", method = RequestMethod.GET)
    public String inbound(@RequestParam(value="productId", required=true) String productId,
                          @RequestParam(value="quantity", required=true) Integer quantity);

    //出库
    @RequestMapping(value = "/inventory/outbound", method = RequestMethod.GET)
    public String outbound(@RequestParam(value="productId", required=true) String productId,
                          @RequestParam(value="quantity", required=true) Integer quantity);

}